package com.xbb.mapper;

import com.xbb.entity.Student;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xbb.entity.StudentParam;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import javax.validation.Valid;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Mr xie
 * @since 2020-06-03
 */
public interface StudentMapper extends BaseMapper<Student> {
    //批量修改学生表的咨询师id
    public  boolean updateBatch(@Param("uid") Integer uid, @Param("ids") String[] ids);

    //咨询经理-获取学生列表
    public List<StudentParam> getStuList(StudentParam studentParam);

    //咨询师-获取学生列表
    public List<StudentParam> getStuListInZiXunShi(StudentParam studentParam);

    //网络咨询师-获取学生列表
    public List<StudentParam> getStuListInWangLuoZiXunShi(StudentParam studentParam);

    //软删除学生
    @Update("update student set is_delete=1 where id =#{id}")
    public boolean ruanShanById(Integer id);

    //获取学生姓名，添加学生验证名字唯一
    @Select("select stu_name from student where stu_name=#{stuName}")
    List<Student> getStuName(@Valid Student student);

    //批量导出学生信息
    public List<StudentParam> queryByIds(@Param("ids")String[] ids);
}
